<template>
	<view class="content">
		<view class="bgImg">
			<image :src="imgList[nowItem].url" mode=""></image>
		</view>
		<view class="topContent">
			<view class="title">
				{{imgList[nowItem].name2}}
			</view>
			<view class="text">
				<text>{{imgList[nowItem].introduce.slice(0,51)}}...</text>
				<text class="details">详情</text>
			</view>
			<view class="but">
				去这里
			</view>
		</view>
		<view class="bottomList">
			<view class="title">
				景点讲解
			</view>
			<view class="list">
				<scroll-view class="scroll-view_H" scroll-x="true" scroll-left="0">
					<view class="box">
						<block v-for="(item,i) in imgList" :key="item.id">
							<view class="item" @click="changeNowItem(i)">
								<view :class="['itemImg',nowItem == i ? 'activate':''] ">
									<image :src="item.url" mode=""></image>
								</view>
								<view class="name">
									{{item.name}}
								</view>
							</view>
						</block>
					</view>
				</scroll-view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imgList: [{
						id: 1,
						name: '五老树',
						name2: '五老树广场',
						introduce: '五老树万年道场，有五颗盘踞环抱在一起的古银杏树，平均树龄达两千多岁。历经岁月劫数，至今安然无恙，颗颗高耸立',
						url: 'https://up.tt98.com/uploadfile/sjbz/2020-08-13/8155b0a06ab10a2f12c2098ecd7f5cb7.jpg'
					},
					{
						id: 2,
						name: '胡氏祠',
						name2: '胡氏祠',
						introduce: '五老树万年道场，有五颗盘踞环抱在一起的古银杏树，平均树龄达两千多岁。历经岁月劫数，至今安然无恙，颗颗高耸立',
						url: 'https://sjbz-fd.zol-img.com.cn/t_s320x510c5/g2/M00/0A/00/ChMlWV5V3gGIWZIcAAkB_nb3LuUAANdrQI9YfwACQIW586.jpg'
					},
					{
						id: 3,
						name: '十里画廊',
						name2: '十里画廊',
						introduce: '五老树万年道场，有五颗盘踞环抱在一起的古银杏树，平均树龄达两千多岁。历经岁月劫数，至今安然无恙，颗颗高耸立',
						url: 'https://up.tt98.com/uploadfile/sjbz/2020-08-13/8155b0a06ab10a2f12c2098ecd7f5cb7.jpg'
					},
					{
						id: 4,
						name: '石磨博物馆',
						name2: '石磨博物馆',
						introduce: '五老树万年道场，有五颗盘踞环抱在一起的古银杏树，平均树龄达两千多岁。历经岁月劫数，至今安然无恙，颗颗高耸立',
						url: 'https://sjbz-fd.zol-img.com.cn/t_s320x510c5/g2/M00/0A/00/ChMlWV5V3gGIWZIcAAkB_nb3LuUAANdrQI9YfwACQIW586.jpg'
					},
					{
						id: 5,
						name: '五老树',
						name: '石磨博物馆',
						name2: '石磨博物馆',
						introduce: '五老树万年道场，有五颗盘踞环抱在一起的古银杏树，平均树龄达两千多岁。历经岁月劫数，至今安然无恙，颗颗高耸立',
						url: 'https://up.tt98.com/uploadfile/sjbz/2020-08-13/8155b0a06ab10a2f12c2098ecd7f5cb7.jpg'
					},
					{
						id: 6,
						name: '胡氏祠',
						name: '石磨博物馆',
						name2: '石磨博物馆',
						introduce: '五老树万年道场，有五颗盘踞环抱在一起的古银杏树，平均树龄达两千多岁。历经岁月劫数，至今安然无恙，颗颗高耸立',
						url: 'https://sjbz-fd.zol-img.com.cn/t_s320x510c5/g2/M00/0A/00/ChMlWV5V3gGIWZIcAAkB_nb3LuUAANdrQI9YfwACQIW586.jpg'
					},
				],
				nowItem: 0, //当前项
			};
		},
		methods: {
			changeNowItem(num) {
				this.nowItem = num * 1
			}
		}
	}
</script>

<style lang="less">
	@radius: 16rpx; //圆角
	@h1: 36rpx; //大标题
	@h2: 32rpx; //二级标题
	@h3: 28rpx; //三级标题
	@text: 24rpx; //四级标题、标签、说明文字
	//颜色
	@color1: #C78748;
	@color2: #FFBF81;
	@color3: #673A19;
	@color4: #42BAE7;
	@color5: #5D9319;
	@color6: #E0593B;
	@color7: #FFF9EF;
	//间距
	@interval1: 72rpx;
	@interval2: 48rpx;
	@interval3: 32rpx;
	@interval4: 16rpx;

	.content {
		position: relative;
		color: #FFF;
	}

	.bgImg {
		font-size: 0;

		image {
			width: 750rpx;
			height: 100vh;
		}
	}

	.bottomList {
		position: absolute;
		left: @interval2;
		bottom: @interval1;
		.title{
			margin-bottom: @interval4;
		}
	}

	.scroll-view_H {
		white-space: nowrap;
		width: 686rpx;
	}

	.box {
		display: flex;

		.item {
			width: 150rpx;
			margin-left: @interval2;
			text-align: center;
		}

		.activate {
			border: 1rpx solid #FFF;
		}

		& .item:first-child {
			width: 150rpx;
			margin-left: 0;
		}

		.itemImg {
			font-size: 0;
			border-radius: @radius;
			overflow: hidden;
			box-sizing: border-box;
			margin-bottom: @interval4;
			image {
				width: 150rpx;
				height: 150rpx;
			}
		}

		.name {
			font-size: @h3;

		}
	}

	.topContent {
		width: 686rpx;
		padding: @interval3;
		position: absolute;
		font-size: @text;
		top: 150rpx;
		.title {
			font-size: @h1;
			text-align: right;
			margin-bottom: @interval3;
		}

		.text {
			width: 28em;
			position: relative;
			overflow: hidden;
			text-overflow: '...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
			display: -webkit-box;
			-webkit-line-clamp: 2;
			-webkit-box-orient: vertical;
		}

		.details {
			position: absolute;
			text-decoration: underline;
			bottom: 0;
			right: 0;
		}
		.but{
			background-color: #FFFFFF33;
			border: #FFF 1rpx solid;
			width: 3em;
			line-height: 2em;
			padding: 0 .8em ;
			border-radius: 1em;
			margin: @interval3 @interval3 0 0;
			position: absolute;
			right: 0;
		}
	}
</style>
